package com.wsc.wisdomchina.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.wsc.wisdomchina.R;
import com.wsc.wisdomchina.javaBean.CommitteeNewsListBean;

import java.util.List;

/**
 * 居委信息适配器
 * Created by ${wangtao} on 2017/3/1.
 */

public class JWXX_Adapter extends BaseAdapter {

    private Context context;
    private List<CommitteeNewsListBean> messageBeen;
    private LayoutInflater mInflater;

    public JWXX_Adapter(Context context, List<CommitteeNewsListBean> messageBeen) {
        this.context = context;
        this.messageBeen = messageBeen;
        mInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return messageBeen.size();
    }

    @Override
    public Object getItem(int position) {
        return messageBeen.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {

        ViewHolder holder = null;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.item_jwxx, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.item_jwxx_name.setText(messageBeen.get(position).getName());
        return convertView;

    }
    public class ViewHolder {
        private TextView item_jwxx_name;//标题

        public ViewHolder(View view) {

            item_jwxx_name = (TextView) view.findViewById(R.id.item_jwxx_name);
        }
    }


}
